New function to get a GdkWindow to compare event->window to.
authorJonathan Blandford <jrb@redhat.com>
Thu, 15 Nov 2001 22:20:18 +0000 (22:20 +0000)
committerJonathan Blandford <jrb@src.gnome.org>
Thu, 15 Nov 2001 22:20:18 +0000 (22:20 +0000)
Thu Nov 15 16:24:55 2001  Jonathan Blandford  <jrb@redhat.com>

* gtk/gtktreeview.c (gtk_tree_view_get_bin_window): New function
to get a GdkWindow to compare event->window to.

* gtk/gtktreeview.c (gtk_tree_view_move_cursor_left_right): emit
the signal for lateral motion too, #64361

* gtk/gtktreeview.c (gtk_tree_view_get_path_at_pos): remove window
arg as it is useless, #64137

17 files changed:
ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
docs/reference/gtk/tmpl/gtk-unused.sgml
docs/reference/gtk/tmpl/gtktextbuffer.sgml
docs/reference/gtk/tmpl/gtktextiter.sgml
docs/reference/gtk/tmpl/gtktexttagtable.sgml
docs/reference/gtk/tmpl/gtktreemodel.sgml
docs/reference/gtk/tmpl/gtktreemodelsort.sgml
docs/reference/gtk/tmpl/gtktreeselection.sgml
docs/reference/gtk/tmpl/gtktreeview.sgml
gtk/gtktreeview.c
gtk/gtktreeview.h

index decbb736cfc2ff7d6e870758a0cf6430a43465c6..e92cdfab617dfa76d627cc0a0f64f7cc63434584 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+Thu Nov 15 16:24:55 2001  Jonathan Blandford  <jrb@redhat.com>
+
+       * gtk/gtktreeview.c (gtk_tree_view_get_bin_window): New function
+       to get a GdkWindow to compare event->window to.
+
+       * gtk/gtktreeview.c (gtk_tree_view_move_cursor_left_right): emit
+       the signal for lateral motion too, #64361
+
+       * gtk/gtktreeview.c (gtk_tree_view_get_path_at_pos): remove window
+       arg as it is useless, #64137
+
 Thu Nov 15 16:07:42 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtknotebook.c: Some small drawing fixes for scroll arrows.
index decbb736cfc2ff7d6e870758a0cf6430a43465c6..e92cdfab617dfa76d627cc0a0f64f7cc63434584 100644 (file)
@@ -1,3 +1,14 @@
+Thu Nov 15 16:24:55 2001  Jonathan Blandford  <jrb@redhat.com>
+
+       * gtk/gtktreeview.c (gtk_tree_view_get_bin_window): New function
+       to get a GdkWindow to compare event->window to.
+
+       * gtk/gtktreeview.c (gtk_tree_view_move_cursor_left_right): emit
+       the signal for lateral motion too, #64361
+
+       * gtk/gtktreeview.c (gtk_tree_view_get_path_at_pos): remove window
+       arg as it is useless, #64137
+
 Thu Nov 15 16:07:42 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtknotebook.c: Some small drawing fixes for scroll arrows.
index decbb736cfc2ff7d6e870758a0cf6430a43465c6..e92cdfab617dfa76d627cc0a0f64f7cc63434584 100644 (file)
@@ -1,3 +1,14 @@
+Thu Nov 15 16:24:55 2001  Jonathan Blandford  <jrb@redhat.com>
+
+       * gtk/gtktreeview.c (gtk_tree_view_get_bin_window): New function
+       to get a GdkWindow to compare event->window to.
+
+       * gtk/gtktreeview.c (gtk_tree_view_move_cursor_left_right): emit
+       the signal for lateral motion too, #64361
+
+       * gtk/gtktreeview.c (gtk_tree_view_get_path_at_pos): remove window
+       arg as it is useless, #64137
+
 Thu Nov 15 16:07:42 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtknotebook.c: Some small drawing fixes for scroll arrows.
index decbb736cfc2ff7d6e870758a0cf6430a43465c6..e92cdfab617dfa76d627cc0a0f64f7cc63434584 100644 (file)
@@ -1,3 +1,14 @@
+Thu Nov 15 16:24:55 2001  Jonathan Blandford  <jrb@redhat.com>
+
+       * gtk/gtktreeview.c (gtk_tree_view_get_bin_window): New function
+       to get a GdkWindow to compare event->window to.
+
+       * gtk/gtktreeview.c (gtk_tree_view_move_cursor_left_right): emit
+       the signal for lateral motion too, #64361
+
+       * gtk/gtktreeview.c (gtk_tree_view_get_path_at_pos): remove window
+       arg as it is useless, #64137
+
 Thu Nov 15 16:07:42 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtknotebook.c: Some small drawing fixes for scroll arrows.
index decbb736cfc2ff7d6e870758a0cf6430a43465c6..e92cdfab617dfa76d627cc0a0f64f7cc63434584 100644 (file)
@@ -1,3 +1,14 @@
+Thu Nov 15 16:24:55 2001  Jonathan Blandford  <jrb@redhat.com>
+
+       * gtk/gtktreeview.c (gtk_tree_view_get_bin_window): New function
+       to get a GdkWindow to compare event->window to.
+
+       * gtk/gtktreeview.c (gtk_tree_view_move_cursor_left_right): emit
+       the signal for lateral motion too, #64361
+
+       * gtk/gtktreeview.c (gtk_tree_view_get_path_at_pos): remove window
+       arg as it is useless, #64137
+
 Thu Nov 15 16:07:42 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtknotebook.c: Some small drawing fixes for scroll arrows.
index decbb736cfc2ff7d6e870758a0cf6430a43465c6..e92cdfab617dfa76d627cc0a0f64f7cc63434584 100644 (file)
@@ -1,3 +1,14 @@
+Thu Nov 15 16:24:55 2001  Jonathan Blandford  <jrb@redhat.com>
+
+       * gtk/gtktreeview.c (gtk_tree_view_get_bin_window): New function
+       to get a GdkWindow to compare event->window to.
+
+       * gtk/gtktreeview.c (gtk_tree_view_move_cursor_left_right): emit
+       the signal for lateral motion too, #64361
+
+       * gtk/gtktreeview.c (gtk_tree_view_get_path_at_pos): remove window
+       arg as it is useless, #64137
+
 Thu Nov 15 16:07:42 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtknotebook.c: Some small drawing fixes for scroll arrows.
index decbb736cfc2ff7d6e870758a0cf6430a43465c6..e92cdfab617dfa76d627cc0a0f64f7cc63434584 100644 (file)
@@ -1,3 +1,14 @@
+Thu Nov 15 16:24:55 2001  Jonathan Blandford  <jrb@redhat.com>
+
+       * gtk/gtktreeview.c (gtk_tree_view_get_bin_window): New function
+       to get a GdkWindow to compare event->window to.
+
+       * gtk/gtktreeview.c (gtk_tree_view_move_cursor_left_right): emit
+       the signal for lateral motion too, #64361
+
+       * gtk/gtktreeview.c (gtk_tree_view_get_path_at_pos): remove window
+       arg as it is useless, #64137
+
 Thu Nov 15 16:07:42 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtknotebook.c: Some small drawing fixes for scroll arrows.
index 86e08b9c736d2731130d05b514858504c0a01902..c417931a860dfb3d395a900eb3f71d33f75a777a 100644 (file)
@@ -1158,12 +1158,6 @@ produce superscript and subscript.
 </para>
 
 
-<!-- ##### STRUCT GtkTreeModelSort ##### -->
-<para>
-
-</para>
-
-
 <!-- ##### STRUCT GtkTreeSelectionClass ##### -->
 <para>
 
@@ -1178,14 +1172,6 @@ produce superscript and subscript.
 @GTK_TREE_SELECTION_SINGLE: 
 @GTK_TREE_SELECTION_MULTI: 
 
-<!-- ##### STRUCT GtkTreeView ##### -->
-<para>
-
-</para>
-
-@parent: 
-@priv: 
-
 <!-- ##### USER_FUNCTION GtkTreeViewDraggableFunc ##### -->
 <para>
 
index 8847b6c0128a14ce56c1cb62d83440c79918b100..0c72d90755ee5f1324f4e43e028af5d8a72e705f 100644 (file)
@@ -23,6 +23,12 @@ types related to the text widget and how they work together.
 #GtkTextView, #GtkTextIter, #GtkTextMark
 </para>
 
+<!-- ##### STRUCT GtkTextBuffer ##### -->
+<para>
+
+</para>
+
+
 <!-- ##### FUNCTION gtk_text_buffer_new ##### -->
 <para>
 
index 1815bd9654b63e913a6120de3212c5ed6e6c8aa0..404451f6049f57a81b60637149c7fc9443417132 100644 (file)
@@ -20,12 +20,6 @@ types related to the text widget and how they work together.
 
 </para>
 
-<!-- ##### STRUCT GtkTextBuffer ##### -->
-<para>
-
-</para>
-
-
 <!-- ##### STRUCT GtkTextIter ##### -->
 <para>
 
index 6727f3098d6ab5508c235eafbfb921ddb61a7031..bdae305c3bd56b54b8a9e86667d598e2f1928363 100644 (file)
@@ -21,6 +21,12 @@ types related to the text widget and how they work together.
 
 </para>
 
+<!-- ##### STRUCT GtkTextTagTable ##### -->
+<para>
+
+</para>
+
+
 <!-- ##### USER_FUNCTION GtkTextTagTableForeach ##### -->
 <para>
 
index c2a0f8eecff16a6f1b6ebfbebac848479261ea74..ea67be9962ec051e2c991d27ee6ef3c2c13aa71d 100644 (file)
@@ -14,6 +14,12 @@ The tree interface used by #GtkTreeView
 #GtkTreeView, #GtkTreeStore, #GtkListStore
 </para>
 
+<!-- ##### STRUCT GtkTreeModel ##### -->
+<para>
+
+</para>
+
+
 <!-- ##### STRUCT GtkTreeIter ##### -->
 <para>
 
@@ -36,12 +42,6 @@ The tree interface used by #GtkTreeView
 </para>
 
 
-<!-- ##### STRUCT GtkTreeModel ##### -->
-<para>
-
-</para>
-
-
 <!-- ##### STRUCT GtkTreeModelIface ##### -->
 <para>
 
index 31dd65af5787a004dfd588cf0e2318d551c1a662..59ecc5ada583ee1151a6fab3cb0890f3cd12255f 100644 (file)
@@ -14,6 +14,12 @@ GtkTreeModelSort
 
 </para>
 
+<!-- ##### STRUCT GtkTreeModelSort ##### -->
+<para>
+
+</para>
+
+
 <!-- ##### FUNCTION gtk_tree_model_sort_new_with_model ##### -->
 <para>
 
index 58fd23924299137348b8593279123b3255eb7397..35a293cc83833666440d70298fc6288c664a7e27 100644 (file)
@@ -14,6 +14,12 @@ GtkTreeSelection
 
 </para>
 
+<!-- ##### STRUCT GtkTreeSelection ##### -->
+<para>
+
+</para>
+
+
 <!-- ##### USER_FUNCTION GtkTreeSelectionFunc ##### -->
 <para>
 
index b8480449e853826f0932dec1d0fc81d9d57fceed..f9692b2e74f172cb06eed5c7cc842b18f0b0d752 100644 (file)
@@ -14,6 +14,12 @@ GtkTreeView
 
 </para>
 
+<!-- ##### STRUCT GtkTreeView ##### -->
+<para>
+
+</para>
+
+
 <!-- ##### ENUM GtkTreeViewDropPosition ##### -->
 <para>
 
index c36a7496d519846e21d189cdeca3e64dbddcb9f5..eb5690015904fd645b4893973b2da2a467d3b34b 100644 (file)
@@ -3497,7 +3497,6 @@ gtk_tree_view_maybe_begin_dragging_row (GtkTreeView      *tree_view,
   tree_view->priv->pressed_button = -1;
 
   gtk_tree_view_get_path_at_pos (tree_view,
-                                 tree_view->priv->bin_window,
                                  tree_view->priv->press_start_x,
                                  tree_view->priv->press_start_y,
                                  &path,
@@ -6000,6 +5999,7 @@ gtk_tree_view_move_cursor_left_right (GtkTreeView *tree_view,
                                     cursor_tree,
                                     cursor_node,
                                     NULL);
+      g_signal_emit (G_OBJECT (tree_view), tree_view_signals[CURSOR_CHANGED], 0);
     }
   gtk_tree_view_clamp_column_visible (tree_view, tree_view->priv->focus_column);
 }
@@ -8140,10 +8140,27 @@ gtk_tree_view_set_cursor (GtkTreeView       *tree_view,
 }
 
 
+/**
+ * gtk_tree_view_get_bin_window:
+ * @tree_view: A #GtkTreeView
+ * 
+ * Returns the window that @tree_view renders to.  This is used primarily to
+ * compare to <literal>event->window</literal> to confirm that the event on
+ * @tree_view is on the right window.
+ * 
+ * Return value: A #GdkWindow, or %NULL when @tree_view hasn't been realized yet
+ **/
+GdkWindow *
+gtk_tree_view_get_bin_window (GtkTreeView *tree_view)
+{
+  g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), NULL);
+
+  return tree_view->priv->bin_window;
+}
+
 /**
  * gtk_tree_view_get_path_at_pos:
  * @tree_view: A #GtkTreeView.
- * @window: The #GdkWindow to check against.
  * @x: The x position to be identified.
  * @y: The y position to be identified.
  * @path: A pointer to a #GtkTreePath pointer to be filled in, or %NULL
@@ -8151,22 +8168,20 @@ gtk_tree_view_set_cursor (GtkTreeView       *tree_view,
  * @cell_x: A pointer where the X coordinate relative to the cell can be placed, or %NULL
  * @cell_y: A pointer where the Y coordinate relative to the cell can be placed, or %NULL
  *
- * Finds the path at the point (@x, @y) relative to @window.  If @window is
- * %NULL, then the point is found relative to the widget coordinates.  This
- * function is expected to be called after an event, with <literal>event->window</literal> being
- * passed in as @window.  It is primarily for things like popup menus.  If @path
- * is non-%NULL, then it will be filled with the #GtkTreePath at that point.
- * This path should be freed with gtk_tree_path_free().  If @column is non-%NULL,
- * then it will be filled with the column at that point. @cell_x and @cell_y
- * return the coordinates relative to the cell background (i.e. the
- * @background_area passed to gtk_cell_renderer_render()).  This function only
- * works if @tree_view is realized.
+ * Finds the path at the point (@x, @y), relative to widget coordinates.  That
+ * is, @x and @y are relative to an events coordinates.  It is primarily for
+ * things like popup menus.  If @path is non-%NULL, then it will be filled with
+ * the #GtkTreePath at that point.  This path should be freed with
+ * gtk_tree_path_free().  If @column is non-%NULL, then it will be filled with
+ * the column at that point. @cell_x and @cell_y return the coordinates relative
+ * to the cell background (i.e. the @background_area passed to
+ * gtk_cell_renderer_render()).  This function is only meaningful if @tree_view
+ * is realized.
  *
  * Return value: %TRUE if a row exists at that coordinate.
  **/
 gboolean
 gtk_tree_view_get_path_at_pos (GtkTreeView        *tree_view,
-                              GdkWindow          *window,
                               gint                x,
                               gint                y,
                               GtkTreePath       **path,
@@ -8181,9 +8196,6 @@ gtk_tree_view_get_path_at_pos (GtkTreeView        *tree_view,
   g_return_val_if_fail (tree_view != NULL, FALSE);
   g_return_val_if_fail (tree_view->priv->bin_window != NULL, FALSE);
 
-  if (window)
-    g_return_val_if_fail (window == tree_view->priv->bin_window, FALSE);
-
   if (path)
     *path = NULL;
   if (column)
@@ -8239,21 +8251,12 @@ gtk_tree_view_get_path_at_pos (GtkTreeView        *tree_view,
         }
     }
 
-  if (window)
-    {
-      y_offset = _gtk_rbtree_find_offset (tree_view->priv->tree,
-                                          TREE_WINDOW_Y_TO_RBTREE_Y (tree_view, y),
-                                          &tree, &node);
-    }
-  else
-    {
-      if (y < TREE_VIEW_HEADER_HEIGHT (tree_view))
-       return FALSE;
+  if (y < TREE_VIEW_HEADER_HEIGHT (tree_view))
+    return FALSE;
 
-      y_offset = _gtk_rbtree_find_offset (tree_view->priv->tree,
-                                          TREE_WINDOW_Y_TO_RBTREE_Y (tree_view, y + tree_view->priv->vadjustment->value),
-                                          &tree, &node);
-    }
+  y_offset = _gtk_rbtree_find_offset (tree_view->priv->tree,
+                                     TREE_WINDOW_Y_TO_RBTREE_Y (tree_view, y + tree_view->priv->vadjustment->value),
+                                     &tree, &node);
 
   if (tree == NULL)
     return FALSE;
@@ -8690,7 +8693,6 @@ gtk_tree_view_get_dest_row_at_pos (GtkTreeView             *tree_view,
    */
 
   if (!gtk_tree_view_get_path_at_pos (tree_view,
-                                      tree_view->priv->bin_window,
                                       x, y,
                                       &tmp_path,
                                       &column,
index d6c56bd944925960bd282df0e09f6546d0ece72f..5e132658dc908301895de76b0f779a17ad1ce9f2 100644 (file)
@@ -217,7 +217,6 @@ void                   gtk_tree_view_get_cursor                    (GtkTreeView
 
 /* Layout information */
 gboolean               gtk_tree_view_get_path_at_pos               (GtkTreeView               *tree_view,
-                                                                   GdkWindow                 *window,
                                                                    gint                       x,
                                                                    gint                       y,
                                                                    GtkTreePath              **path,